/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package managedBean;

import Merlion.SCM.bean.InventoryMovementsManagementBeanRemote;
import Merlion.util.state.InventoryMovementState;
import java.util.List;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
import javax.faces.event.PhaseEvent;


@ManagedBean(name = "InventoryMovementManagedBean")
@ViewScoped
public class InventoryMovementManagedBean {

    private InventoryMovementState selectedInvState;
    private List<InventoryMovementState> invStateList;
    @EJB
    private InventoryMovementsManagementBeanRemote imm;

    /** Creates a new instance of InventoryMovementManagedBean */
    public InventoryMovementManagedBean() {
    }

    public void initView(PhaseEvent event) {
        if (invStateList == null) {
            invStateList = imm.viewInventoryMovementLog();
        }
    }

    public List<InventoryMovementState> getInvStateList() {
        if (invStateList == null) {
            invStateList = imm.viewInventoryMovementLog();
        }
        return invStateList;
    }

    public void setInvStateList(List<InventoryMovementState> invStateList) {
        this.invStateList = invStateList;
    }

    public InventoryMovementState getSelectedInvState() {
        return selectedInvState;
    }

    public void setSelectedInvState(InventoryMovementState selectedInvState) {
        this.selectedInvState = selectedInvState;
    }
}
